package my.suveng.oauth2.model.struct;

import my.suveng.oauth2.model.dto.GroupAddDto;
import my.suveng.oauth2.service.db.mysql.model.entity.SysGroup;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface SysGroupStructMapper {

    SysGroupStructMapper INSTANCE = Mappers.getMapper(SysGroupStructMapper.class);

    /**
     * dto -> entity
     * 
     * @author suwenguang
     */
    @Mappings({ @Mapping(target = "name", source = "dto.name"), })
    SysGroup dto2entity(GroupAddDto dto);

    List<SysGroup> dtos2entitys(List<GroupAddDto> dtos);

}
